package com.example.football.mapper;

import com.example.football.pojo.Yuyue;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface YuyueMapper {
    @Insert("insert into yuyue(time,date,site) values(#{time},#{date},#{site})")
    void insertYuyue(Yuyue yuyue);

    @Select("select * from yuyue where date=#{date} and time=#{time} and site=#{site}")
    Yuyue findYuyueBydate(Yuyue yuyue);

    @Select("select * from yuyue where site=#{site}")
    List<Yuyue> findYuyueBysite(Yuyue yuyue);

    @Update("update yuyue set team1=#{team1} where id=#{id}")
    void updateYuyueByteam1(Yuyue yuyue);

    @Update("update yuyue set team2=#{team2} where id=#{id}")
    void updateYuyueByteam2(Yuyue yuyue);

    @Select("select * from yuyue where team1=#{team1} or team2=#{team2}")
    List<Yuyue> findYueyueByteam(Yuyue yuyue);
}
